﻿using System;
using System.ComponentModel.DataAnnotations.Schema;
using Volo.Abp.Domain.Entities;

namespace HCMS.Entities.Base
{
    /// <summary>
    /// 网站前端监控 - 异常日志
    /// </summary>
    [Table("front_end_error_logs")]
    public class FrontEndErrorLogs : Entity<int>
    {
        /// <summary>
        /// Id
        /// </summary>
        public new int Id { get; set; }

        /// <summary>
        /// 创建 时间
        /// </summary>
        [Column("create_time")]
        public DateTime CreateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 应用 Id
        /// </summary>
        [Column("app_id")]
        public int AppId { get; set; }

        /// <summary>
        /// 用户 唯一标识
        /// </summary>
        [Column("uid")]
        public string Uid { get; set; } = string.Empty;

        /// <summary>
        /// 页面链接地址
        /// </summary>
        [Column("url")]
        public string Url { get; set; } = string.Empty;

        /// <summary>
        /// 客户端 时间
        /// </summary>
        [Column("client_time")]
        public DateTime ClientTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 客户端 系统
        /// </summary>
        [Column("client_system")]
        public string ClientSystem { get; set; } = string.Empty;

        /// <summary>
        /// 用户代理信息
        /// </summary>
        [Column("user_agent")]
        public string UserAgent { get; set; } = string.Empty;

        /// <summary>
        /// 网络类型
        /// </summary>
        [Column("network_type")]
        public string NetworkType { get; set; } = string.Empty;

        /// <summary>
        /// Cookie 信息
        /// </summary>
        [Column("cookie")]
        public string Cookie { get; set; } = string.Empty;

        /// <summary>
        /// 异常 信息
        /// </summary>
        [Column("error_message")]
        public string ErrorMessage { get; set; } = string.Empty;

        /// <summary>
        /// 异常文件路径
        /// </summary>
        [Column("script_url")]
        public string ScriptUrl { get; set; } = string.Empty;

        /// <summary>
        /// 异常 行号
        /// </summary>
        [Column("line_no")]
        public int LineNo { get; set; }

        /// <summary>
        /// 异常 列号
        /// </summary>
        [Column("column_no")]
        public int ColumnNo { get; set; }

        /// <summary>
        /// 异常 堆栈信息
        /// </summary>
        [Column("stack")]
        public string Stack { get; set; } = string.Empty;
    }
}
